/*
============================================================================
 Name        : pd_time.cpp
 Author      : Jian(raphyer@hotmail.com)
 Version     :
 Copyright   : GPL
 Description : pd_time.cpp - source file
============================================================================
*/

// INCLUDE FILES
#include "pd_time.h"

void pd_get_curtime(dd_time* time) 
{
    struct timeval timeSecs;
    gettimeofday(&timeSecs, 0);
    struct tm* curTime = localtime((int*)(&timeSecs.tv_sec));
    time->year          = curTime->tm_yday + 1900 ;
    time->month         = curTime->tm_mon + 1 ;
    time->day           = curTime->tm_mday ;
    time->hour          = curTime->tm_hour ;
    time->minute        = curTime->tm_min;
    time->second        = curTime->tm_sec ;
    time->microsecond   = timeSecs.tv_usec ;
}


/* End of File */
